var React = require('react');

//
// <ModalFooter confirmLabel="确定按钮名称" cancelLabel="取消按钮名称" />
//
// <ModalFooter>
//   ...
// </ModalFooter>
//

module.exports = function ModalFooter(props) {
  return (
    <div className="modal-footer">
      {(typeof props.cancelLabel === 'string' && props.cancelLabel !== '') && (
        <button type="button" className="btn btn-secondary x-btn-cancel" data-dismiss="modal">
          {props.cancelLabel}
        </button>
      )}

      {(typeof props.confirmLabel === 'string' && props.confirmLabel !== '') && (
        <button type="button" className="btn btn-primary x-btn-confirm">
          {props.confirmLabel}
        </button>
      )}

      {props.children}
    </div>
  );
};
